<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>作业1</title>
  <style>
    .activate{color:red}
  </style>
</head>
<body>



<ul id="app">
  <li class="title" :class="{activate:isact===index}" v-for="(a,index) in anime" @click="btnclick(index)">{{a}}</li>
</ul>
<!--<ul id="app">-->
<!--  <li class="title" :class="{activate:isact}" v-for="(a,index) in anime" @click="btnclick()">{{a}}</li>-->
<!--</ul>-->

<script src="../js/vue.js"></script>
<script>
  const app = new Vue({
    el:"#app",
    data: {
      message: "stupid mother fucker",
      anime: ["海贼王", "火影忍者", "进击的巨人", "东京喰种"],

      isact:false,
    },
    methods:{
      btnclick(index){
        this.isact=index
      },
    }
  })
</script>

</body>
</html>